/**
 * Created by bgy on 2016/12/5.
 * 产地质检
 */
import React from 'react';
import {hashHistory} from 'react-router';

import HeaderTitle from '../../components/common/HeaderTitle';
import Warn from '../../components/common/Warn';

var PlaceQT = React.createClass({
  getInitialState:function () {
    return{hidden:'hidden'};
  },
  handlerClick: function () {
    let address = this.refs.address.value;
    let contacts = this.refs.contacts.value;
    let phoneNumber = this.refs.phoneNumber.value;
    let qcApply = JSON.parse(window.localStorage.getItem('qcApply'));
    qcApply.address = address;
    qcApply.contacts = contacts;
    qcApply.phoneNumber = phoneNumber;
    //提交代码；
    window.localStorage.removeItem('qcApply');
    window.localStorage.removeItem('picUploadParam');
    const path = '/';
    hashHistory.push(path);
  },
  render: function () {
    return (
      <div className="full">
        <HeaderTitle title="产地质检"/>
        <div className="content">
          <h2 style={{padding:'20px 0',borderBottom:'1px solid'}}>产地信息</h2>
          <div className="form">
            <div className="form-item textarea">
              <label htmlFor="">产地地址</label><textarea className="textarea" name="" cols="30" rows="3" placeholder="请输入详细地址"></textarea>
            </div>
            <div className="form-item">
              <label htmlFor="">联系人姓名</label><input type="text" ref='contacts' placeholder="请输入联系人姓名"/>
            </div>
            <div className="form-item">
              <label htmlFor="">联系人电话</label><input type="text" ref='num' id='mobile' placeholder="请输入联系人电话"/>
            </div>
            <button style={{marginTop:'100px'}} className="button button-pill button-primary btn-green btn-long" onClick={this.handlerClick} ref="loginBtn">提交</button>
          </div>
        </div>
      </div>
    )
  }
})
export default PlaceQT;
